package com.ironman.mes.config;

import com.mybatisflex.core.audit.AuditManager;
import lombok.extern.slf4j.Slf4j;
import org.noear.solon.annotation.Configuration;
import org.noear.solon.annotation.Init;

@Slf4j
@Configuration
public class DbConfig {

    @Init
    public void init() {
        //开启审计功能
        AuditManager.setAuditEnable(true);
        AuditManager.setMessageCollector(message -> log.info("Flex exec sql took {} ms >>>  {}", message.getElapsedTime(), message.getFullSql()));
    }
}
